﻿Public Class frmNtpClient

    Private Sub frmNtpClient_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.lblTime.Text = Now.ToString("yyyy/MM/dd HH:mm:ss")
        Me.timSys.Enabled = True
    End Sub

    Private Sub timSys_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles timSys.Tick
        Me.lblTime.Text = Now.ToString("yyyy/MM/dd HH:mm:ss")
    End Sub

    Private Sub btnTimeSync_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTimeSync.Click
        Dim _NTPClient As lunLibCs.NTPClient = Nothing
        Try
            _NTPClient = New lunLibCs.NTPClient(Me.txtNtpServer.Text)
            _NTPClient.Connect(True)

        Catch ex As Exception
            Console.WriteLine("ERROR: {0}", ex.Message)
        End Try
    End Sub
End Class
